package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TSrmWorkOrderMapper;
import com.ruoyi.system.domain.TSrmWorkOrder;
import com.ruoyi.system.service.ITSrmWorkOrderService;
import com.ruoyi.common.core.text.Convert;

/**
 * 工单执行列Service业务层处理
 * 
 * @author wuym
 * @date 2021-08-08
 */
@Service
public class TSrmWorkOrderServiceImpl implements ITSrmWorkOrderService 
{
    @Autowired
    private TSrmWorkOrderMapper tSrmWorkOrderMapper;

    /**
     * 查询工单执行列
     * 
     * @param id 工单执行列ID
     * @return 工单执行列
     */
    @Override
    public TSrmWorkOrder selectTSrmWorkOrderById(Long id)
    {
        return tSrmWorkOrderMapper.selectTSrmWorkOrderById(id);
    }

    /**
     * 查询工单执行列列表
     * 
     * @param tSrmWorkOrder 工单执行列
     * @return 工单执行列
     */
    @Override
    public List<TSrmWorkOrder> selectTSrmWorkOrderList(TSrmWorkOrder tSrmWorkOrder)
    {
        return tSrmWorkOrderMapper.selectTSrmWorkOrderList(tSrmWorkOrder);
    }

    /**
     * 新增工单执行列
     * 
     * @param tSrmWorkOrder 工单执行列
     * @return 结果
     */
    @Override
    public int insertTSrmWorkOrder(TSrmWorkOrder tSrmWorkOrder)
    {
        tSrmWorkOrder.setCreateTime(DateUtils.getNowDate());
        return tSrmWorkOrderMapper.insertTSrmWorkOrder(tSrmWorkOrder);
    }

    /**
     * 修改工单执行列
     * 
     * @param tSrmWorkOrder 工单执行列
     * @return 结果
     */
    @Override
    public int updateTSrmWorkOrder(TSrmWorkOrder tSrmWorkOrder)
    {
        tSrmWorkOrder.setUpdateTime(DateUtils.getNowDate());
        return tSrmWorkOrderMapper.updateTSrmWorkOrder(tSrmWorkOrder);
    }
    @Override
    public TSrmWorkOrder selectByWoCode(String woCode) {
        return tSrmWorkOrderMapper.selectByWoCode(woCode);
    }

    /**
     * 删除工单执行列对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTSrmWorkOrderByIds(String ids)
    {
        return tSrmWorkOrderMapper.deleteTSrmWorkOrderByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除工单执行列信息
     * 
     * @param id 工单执行列ID
     * @return 结果
     */
    @Override
    public int deleteTSrmWorkOrderById(Long id)
    {
        return tSrmWorkOrderMapper.deleteTSrmWorkOrderById(id);
    }
}
